﻿using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Ewk.Extensions.UnitTests.StringExtensionsTests
{
    [TestClass]
    public class IsNullOrWhiteSpaceTests
    {
        [TestMethod]
        public void IsNullOrWhiteSpace_must_return_true_when_a_value_is_null()
        {
            string testString = null;
            Assert.IsTrue(testString.IsNullOrWhiteSpace());
        }

        [TestMethod]
        public void IsNullOrWhiteSpace_must_return_true_when_a_value_contains_only_white_space()
        {
            const string testString = "     ";
            Assert.IsTrue(testString.IsNullOrWhiteSpace());
        }

        [TestMethod]
        public void IsNullOrWhiteSpace_must_return_true_when_a_value_is_stringEmpty()
        {
            var testString = string.Empty;
            Assert.IsTrue(testString.IsNullOrWhiteSpace());
        }

        [TestMethod]
        public void IsNullOrWhiteSpace_must_return_false_when_a_value_contains_white_space_and_some_other_character()
        {
            const string testString = "     a";
            Assert.IsFalse(testString.IsNullOrWhiteSpace());
        }
    }
}